package com.xoms.front.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.xoms.front.controller.res.BaseResult;
import com.xoms.front.controller.springmvc.req.PrintOrderParam;
import com.xoms.front.service.PrintService;
import com.xoms.front.service.exception.ServiceException;

@Component
public class PrintController {
	

	Logger logger = LoggerFactory.getLogger(PayController.class);


	@Autowired
	PrintService printServiceImpl;

	public BaseResult printOrder(PrintOrderParam param, HttpServletRequest request, HttpServletResponse response) {
		BaseResult result = new BaseResult();
		try {
			String orderId = param.getOrderId();
			result = printServiceImpl.printOrder(orderId);
		} catch (ServiceException e) {
			result.setServiceException(e);
			logger.error(e.getMessage(), e);
		} catch (Exception e) {
			result.setFlag(false);
			result.setMsg(e.getMessage());
			logger.error(e.getMessage(), e);
		}
		return result;
	}
	
	
	
	
}
